// src/views/Home.vue
<template>
  <view>
    <text>Count: {{ count }}</text>
    <button @tap="increment">Increment</button>
    <button @tap="fetchUser('123')">Fetch User</button>
    <text>User: {{ userName }}</text>
  </view>
</template>

<script setup lang="ts">
import { useStore } from "@/stores";

// 使用 Pinia store
const store = useStore();

// 获取 state 和 getters
const count = store.getCount;
const userName = store.getUserName;

// 调用 actions
const increment = () => {
  store.increment();
};

const fetchUser = (userId: string) => {
  store.fetchUser(userId);
};
</script>
